<?php
# http://projects:8081/cdapp-2kt-api/api/capacity_record_get.php

include_once '_portal.php';

$now = date('Y-m-d H:i:s', strtotime(" -0 hours "));
$sql = "SELECT * FROM `2kt_capacity_record` WHERE `end` >= '{$now}' ORDER BY `start` ASC, `number` DESC";
$res = exec_sql($sql);
if (!$res) {
  output([]);
} else {
  foreach ($res as $i => $r) {
    $res[$i]['content'] = json_parse($r['content']);
  }
  output($res);
}
